package br.ucb.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import br.ucb.beans.ADM;
import br.ucb.connection.FactoryConnection;

public class PessoaDAO {

	public static int addPessoa(ADM adm) throws SQLException, ClassNotFoundException{
		Connection con = FactoryConnection.getInstance().criaConexao();
		String sql="INSERT INTO daoPessoa VALUES(null,?,?,?)";
		PreparedStatement instrucao = con.prepareStatement(sql);
		instrucao.setString(1, adm.getNome());
		instrucao.setString(2, String.valueOf(adm.getSexo()));
		instrucao.setString(3,"A");
		int retorno = instrucao.executeUpdate(); 
		instrucao.close();
		con.close();
		return retorno;
	}

}
